<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>考勤</title>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <link rel="stylesheet" type="text/css" href="<%=path %>/css/f/default.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/navs.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/assignment.css?v=1"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
 	<script src="js/f/tchattendance.js"></script>
  </head>
  <body>
    <div class="all">
  		<jsp:include page="/nav.jsp"></jsp:include>
  		<div class="rightall float-left" id="seeclass">
  			<div class="already">
  				<div class="already-title">
  					<div class="left">当前课程考勤</div>
  				</div>
  				<form action="teacher/courseadd.do" method="post">
	                <div style="margin-top: 15px;">
	                	<span style="margin-left:5%;"></span>
	  					学年:<input type="text" name="courseTerm" class="task" readonly>
	                	<span style="margin-left:5%;"></span>
	  					周次:<select class="task" name="courseWeek">
	  						<c:forEach var="s" begin="1" end="17">
	                        	<option value="${s}">第${s}周</option>
	                        </c:forEach>
	                    </select>
	                	<span style=" margin-left:5%"></span>
	                	星期:<select class="task" name="courseDay">
	                        <option value="一">一</option>
	                        <option value="二">二</option>
	                        <option value="三">三</option>
	                        <option value="四">四</option>
	                        <option value="五">五</option>
	                        <option value="六">六</option>
	                        <option value="日">日</option>
	                    </select>
	                	<span style=" margin-left:5%"></span>
	                	课时:<select class="task" name="courseTime">
	                        <option value="1">上午</option>
	                    	<option value="2">下午</option>
	                    	<option value="3">晚上</option>
	                    </select>
	                </div>
	                <div style="margin-top:15px;">
	                	<span style=" margin-left:5%;"></span>
	                	班级:<select class="task" name="courseClassId"  id="s-class">
	                		<option>请选择</option>
	                		<c:forEach items="${classes}" var="c" >
	                			<option value="${c.classId}">${c.className }</option>
	                		</c:forEach>
	                    </select>
	                    <span style=" margin-left:5%"></span>
	                	课程:<select class="task" name="courseId" id="s-courses" disabled>
	                		<option class="s-default">请选择</option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                		<option class="option-dis" disabled></option>
	                    </select>
	                	<span style=" margin-left:5%"></span>
	                	考勤:<select class="task" name="courseState">
	                        <option value="1">正常上课</option>
	                    	<option value="2">停课</option>
	                    </select>
	                	<span style=" margin-left:5%"></span>
	                	<button class="task btn-style" style="width:18.1%;" type="submit">确认打卡</button>
	                </div>
  				</form>
  			</div>
  			<div class="already">
  				<div class="already-title">
  					<div class="left">历史考勤记录</div>
  				</div>
	  			<form method="post" action="teacher/selectcourse.do">
	                <div style="margin-top: 15px;">
	                	<span style=" margin-left:5%;"></span>
	               		学年:<input type="text" name="courseTerm" class="task">
	                	<span style=" margin-left:5%;"></span>
	  					周次:<select class="task" name="week">
	  						<c:forEach var="s" begin="1" end="17">
	                        	<option value="${s}">第 &nbsp;&nbsp;${s}&nbsp;&nbsp;周</option>
	                        </c:forEach>
	                    </select>
	                	<span style=" margin-left:5%;"></span>
	                	班级:<select class="task" name="ClassId">
	                			<option>请选择</option>
	                		<c:forEach items="${classes}" var="c" >
	                			<option value="${c.classId}">${c.className }</option>
	                		</c:forEach>
	                    </select>
	                	<span style=" margin-left:50px;"></span>
	                	<button class="task btn-style" style="width:18.1%;" type="submit">查找</button>
	                </div>
	            </form>
  				<table>
  					<tr class="tr-style-head">
	  					<td>学期</td>
	  					<td>时间</td>
	  					<td>课程名</td>
	  					<td>出勤率</td>
	  					<td>未出勤名单</td>
	  					<td>停课状态</td>
  					</tr>
  					<c:forEach items="${coursel}" var="c">
	  					<tr class="tr-style">
		  					<td>${c.courseWeek }</td>
		  					<td>星期${c.courseDay }</td>
		  					<td>${c.className }</td>
		  					<td>${c.courseName}</td>
		  					<td><fmt:formatDate value="${c.createTime }" pattern="yyyy-MM-dd hh:mm:ss"/></td>
		  					<td>
		  						<c:if test="${c.courseState==1 }">正常</c:if>
		  						<c:if test="${c.courseState==2 }">听课</c:if>
		  					</td>
		  					<td>${c.courseSuspendedNotice }</td>
	  					</tr>
  					</c:forEach>
  				</table>
  			</div>
            		<c:if test="${pages>1 }">
		               		<div class="previous">
			               		<c:if test="${pageNo>1}">
			                    	<a href="">上一页</a>
			                	</c:if>
			                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
			                   		<c:if test="${p==pageNo }">
			                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
			                   		</c:if>
			                   		<c:if test="${p!=pageNo }">
			                   			<a href="student/stuAttendance.do?pageNo=${p }" >&nbsp;${p}&nbsp;</a>
			                   		</c:if>
			                   	</c:forEach>
			                    <c:if test="${pageNo<pages}">
			                    	<a href="">下一页</a>
			                	</c:if>
		                   	</div>
		                </c:if>
  		</div>
  	</div>
  </body>
</html>
